class Solution:
    def lexicalOrder(self, n: int) -> list:
        # res = [str(i) for i in range(1, n+1)]
        # res.sort()
        # return res
        return [int(j) for j in sorted(str(i) for i in range(1, n+1))]


a = Solution()
print(a.lexicalOrder(13))
